// app.js
App({
  onLaunch() {
    // 获取状态栏和标题栏高度
    const systemInfo = wx.getSystemInfoSync();
    const statusBarHeight = systemInfo.statusBarHeight * (750 / systemInfo.windowWidth);
    const titleBarHeight = 44 * (750 / systemInfo.windowWidth);
    this.globalData.statusBarHeight = statusBarHeight;
    this.globalData.titleBarHeight = titleBarHeight;
    // 设备类型
    if (systemInfo.platform == 'ios') {
      this.globalData.isIOS = true
    } else {
      this.globalData.isIOS = false
    }
    // 展示本地存储能力
    // const logs = wx.getStorageSync('logs') || []
    // logs.unshift(Date.now())
    // wx.setStorageSync('logs', logs)

    // 判断是否有token
    let token = wx.getStorageSync('token')
    if (!token) {
      wx.reLaunch({
        url: '/pages/empower/empower',
      })
    }
  },
  globalData: {
    userInfo: null,
    // 状态栏高度
    statusBarHeight: 0,
    // 标题栏高度
    titleBarHeight: 0
  }
})
